package demo2;

import java.util.Scanner;

public class ZiTest {
    public static void main(String[] args) {
        double money = 20;
        System.out.println("待支付" + money);
        System.out.println("选择：1.银行卡 2.微信 3.支付宝");
        Scanner sc = new Scanner(System.in);
        switch (sc.nextInt()) {
            case 1:
                P bankPay = new BP();
                bankPay.pay(money);
                break;
            case 2:
                P wechatPay = new WP();
                wechatPay.pay(money);
                break;
            case 3:
                P zPay = new ZP();
                zPay.pay(money);
                break;
        }
    }
}
